package com.lablzh.gdxy.repository.assistant;

import com.lablzh.gdxy.entity.assistant.StudentAssistant;
import org.springframework.data.jpa.repository.JpaRepository;

import javax.transaction.Transactional;
import java.util.List;

public interface StudentAssistantRepository extends JpaRepository<StudentAssistant,Integer> {
    @Transactional
    void deleteByProjectIDAndStudentUsername(Integer projectID, String studentUsername);

    List<StudentAssistant> findAllByStudentName(String studentName);

    List<StudentAssistant> findAllByCollege(String college);

    List<StudentAssistant> findAllByCollegeAndMajor(String college, String major);

    List<StudentAssistant> findAllByCollegeAndMajorAndClasses(String college, String major, String classes);

    List<StudentAssistant> findAllByCollegeAndMajorAndGradeAndCategory(String college, String major, String grade, String category);

    @Transactional
    void deleteByProjectID(Integer id);

}
